Suppressing DOORS report popups in DOORS9

Hello,

Is there a DXL function to automatically close DOORS report popups when they are generated? I have a long script that hits an error and will continue to run... but only after the user selects "OK" in the popup. The error that is generated is already saved to a report file, so is there a way to just close the popup right away (so the user doesn't have to) so the script can continue?

Thanks!
a.knight - Thu Dec 30 11:23:28 EST 2010

Re: Suppressing DOORS report popups in DOORS9
Tony_Goodman - Thu Dec 30 15:49:02 EST 2010

You can suppress error reporting as follows:

string err = ""

noError

// do something dodgy

err = lastError

if (err "" != "")
{
infoBox("Something went wrong: " err)
}

The call to noError suppresses error reporting until a call is made to lastError, which ...err... returns the last error.

As an aside, I do not know of a way to suppress the dialog that doors shows when you fail to open a module for exclusive edit because someone else has a lock on it. The only way round this is to check for locks before attempting to edit.

Tony

Re: Suppressing DOORS report popups in DOORS9
a.knight - Thu Dec 30 16:27:02 EST 2010

Tony_Goodman - Thu Dec 30 15:49:02 EST 2010
You can suppress error reporting as follows:

string err = ""

noError

// do something dodgy

err = lastError

if (err "" != "")
{
infoBox("Something went wrong: " err)
}

The call to noError suppresses error reporting until a call is made to lastError, which ...err... returns the last error.

As an aside, I do not know of a way to suppress the dialog that doors shows when you fail to open a module for exclusive edit because someone else has a lock on it. The only way round this is to check for locks before attempting to edit.

Tony

Hi Tony, this is the code I've been using (guess I should have included it in the first place :)). It works great for catching the errors (like a corrupt baseline), but it still halts the script until the user hits "ok" on the error popup. My question is: is there a way to automatically hit "ok" on a dialog box through DXL?

Module fmSafeLoad(Module mModule, Baseline bBaseline, string &sError)
{
Module mNew

if(baselineExists(mModule, bBaseline))
{
noError
mNew = load(mModule, bBaseline, false)
sError = lastError()
}

return mNew
}

So,

Re: Suppressing DOORS report popups in DOORS9
llandale - Wed Jan 05 16:48:29 EST 2011

You can do this mindfully. As Tony said trap the errors with noError()/lastError(); and if there's an error use the following:

void closeDB(DB dbXX)
{  hide(dbXX)
}
 
void    RealizeMessage(string Message)
{
        DB db = create("")
        DBE dbe = label(db, Message)
        close(db, false, closeDB)
        realize(db)
}
RealizeMessage("Hello\n2nd Line")
 
print "Hello"


Notice there is no 'show' so the code continues, but the message is displayed until the user hits the X. Had some trouble with the close button so I suppressed it.

The 'Message' cannot be complicated, more than a couple EOLs and TABs mess it up.

 

 

  • Louie